;====================================================================
; Project:     The Suspect 
; Version:     0.1
; Author:      Marco Sessa
; Email:       marcosessa@gmail.com
; Copyright:   Zarkosoft
; Description: 
;              15 July 2011     
;                   
;====================================================================
Include "players.bb"
Include "constants.bb"


Function selectRandomCharacter()
  Local suspectId = Rand(1,maxChars)
  Return suspectId
End Function


Function checkAttributes(attribute,value,suspectIdplayer)
  Local suspectRealValue
  
  suspectRealValue = players(suspectIdplayer, attribute) ;suspectIdplayer1
  
  
;  players(n, 3) = isMale
;  players(n, 4) = isWhite
;  players(n, 5) = hairColor
;  players(n, 6) = hairLenght
;  players(n, 7) = eyesColor
;  players(n, 8) = hasMustache
;  players(n, 9) = hasSideburns
;  players(n, 10) = hasEarring 
;  players(n, 11) = hasGlasses
;  players(n, 12) = hasHat
;  players(n, 13) = hasNeo
;  players(n, 14) = hasNecklace
;  players(n, 15) = hasPitOnTheChin
;  
  For pl.player = Each player
    Select attribute
      Case 3
        If pl\isMale <> suspectRealValue Then
          Delete pl
          removedChars = removedChars + 1          
        EndIf  
      Case 4
        If pl\isWhite <> suspectRealValue Then
          Delete pl
          removedChars = removedChars + 1          
        EndIf  
      Case 5 ;TOFIX cancellare solo i personaggi con il colore dei capelli che l'utente ha chiesto
        If value = suspectRealValue
          If pl\hairColor <> suspectRealValue Then
            Delete pl
            removedChars = removedChars + 1
          EndIf
        Else
          If pl\hairColor = value Then
            Delete pl
            removedChars = removedChars + 1
          EndIf  
        EndIf  
      Case 6 ;TOFIX cancellare solo i personaggi con il tipo di capelli richiesti che l'utente ha chiesto
        If value = suspectRealValue Then
          If pl\hairLenght<> suspectRealValue Then
            Delete pl
            removedChars = removedChars + 1
          EndIf
        Else
          If pl\hairLenght = value Then
            Delete pl
            removedChars = removedChars + 1
          EndIf  
        EndIf
      Case 7 ;TOFIX cancellare solo i personaggi con il colore degli occhi che l'utente ha chiesto
        If value = suspectRealValue Then
          If pl\eyesColor<> suspectRealValue Then
            Delete pl
            removedChars = removedChars + 1
          EndIf
        Else
          If pl\eyesColor = value Then
            Delete pl
            removedChars = removedChars + 1
          EndIf  
        EndIf
      Case 8
        If pl\hasMustache <> suspectRealValue Then
          Delete pl
          removedChars = removedChars + 1          
        EndIf  
      Case 9
        If pl\hasSideburns <> suspectRealValue Then
          Delete pl
          removedChars = removedChars + 1          
        EndIf  
      Case 10
        If pl\hasEarring <> suspectRealValue Then
          Delete pl
          removedChars = removedChars + 1          
        EndIf  
      Case 11
        If pl\hasGlasses<> suspectRealValue Then
          Delete pl
          removedChars = removedChars + 1          
        EndIf  
      Case 12
        If pl\hasHat <> suspectRealValue Then
          Delete pl
          removedChars = removedChars + 1          
        EndIf
      Case 13
        If pl\hasNeo <> suspectRealValue Then
          Delete pl
          removedChars = removedChars + 1          
        EndIf
      Case 14
        If pl\hasNecklace <> suspectRealValue Then
          Delete pl
          removedChars = removedChars + 1          
        EndIf
      Case 15
        If pl\hasPitOnTheChin <> suspectRealValue Then
          Delete pl
          removedChars = removedChars + 1          
        EndIf
;Case
      Default
    End Select
  Next
End Function


Function newGame()
;-------------------------------------------
;selectRandomCharacter
;-------------------------------------------
  suspectIdPlayer1 = selectRandomCharacter()
  suspectIdPlayer2 = selectRandomCharacter()
  
  
End Function
;~IDEal Editor Parameters:
;~C#Blitz3D